home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
COMM
/
INTERNET
/
NEWS
/
TRANSPORTS
/
smtpd
/
Help!
< prev
next >
Wrap
Text File
|
1995-11-17
|
9KB
|
185 lines
User Documentation for Ant's RISC OS SMTP Daemon version 0.10
=============================================================
Requirements
------------
You will require a working TCP/IP stack (eg Acorn's !TCPIP or FreeNet) to use this module,
and also the 'InetDB' module which is distributed with FreeNet.
Intro
-----
'smtpd' is a RISC OS module which provides a number of the features commonly found in SMTP
daemons on other, larger computers. Chief among these is the ability to accept connections
from other SMTP daemons, and process mail to multiple users at the local site. Also significant
is the fact that the module does all this in the background, regardless of whether the machine
is in the desktop or not.
'smtpd' broadly conforms to the 'minimal implementation' defined in RFC 821, and also adheres rather
strictly to the buffer length limits specified therein. Allegedly, this minimal installation has
been superceeded by a later RFC, so I might conform to this in a later version, once I've finished
arguing about it with Stewart. :) 'smtpd' is intended for receiving mail
only, ie it expects to be the last host in any given forward path. 'smtpd' does not currently
allow the sending of mail to other hosts, nor does it implement mail forwarding. Currently, 'smtpd'
will allow only 1 connection from a remote host at a time, which isn't envisioned as being a
problem. This can be bumped up in a later release if necessary.
Optionally, 'smtpd' will provide basic logging and host authentication services.
The rationale for the strict buffer length limits, and the provision of only a single connection
at a time, is that I want to keep the memory and performance hits for this module as low as possible.
Commands & Responses
--------------------
'smtpd' responds to the following RFC 821 commands: HELO, MAIL, RCPT, DATA, RSET, QUIT, NOOP, EXPN
and HELP. It does not respond to VRFY, SEND, SAML, SOML, or TURN. 'smtpd' will return standard
responses for these commands, and for any other input it will return '500 Syntax error, command not
recognized'.
After rereading the RFC, I've a feeling that EXPN may actually be doing VRFY's job, so the supported
commands may change in a future release. SOML will probably be supported in the next release, and the
remaining commands will follow in the full implementation (send as well as receive mail).
Environment
-----------
'smtpd' requires a number of files to work correctly. It expects to find these files in the directory
specified by the environment variable <SMTPConfig$Dir>. Currently 'smtpd' expects to find the file
'users' in this directory, and depending on the command line options it may also want to read 'hosts'
and write to 'logfile' in the directory.
Command line arguments
----------------------
Typically, 'smtpd' is invoked via the command line,
RMLoad smtpd [options]
where [options] consists of any of the following (order or case are irrelevant):
-port <n> set the port number smtpd listens on to 'n' (default = 25)
-host <string> sets hostname to <string>. By default smtpd will work this out for itself.
-hostname <string> same as above
-quiet causes smtpd to generate as little output as possible.
Errors are still reported. (disabled by default).
-silent same as above
-secure causes smtpd to run in 'secure' mode (see below). (disabled by default).
-logfile causes smtpd to keep a log of events in <SMTPConfig$Dir>.logfile
(disabled by default).
If no options are specified, smtpd defaults to -port 25 -host <Inet$HostName>.
The 'users' file
----------------
The file "<SMTPConfig$Dir>.users" tells smtpd what to do with mail for a specific user. If smtpd receives
a request for a user who's name is not in this file, the request will be denied.
This file consists of lines, which may be one of three forms. They are either:
1) a comment line - any line which starts with a # is ignored
2) a mailbox line - tells smtpd where to put the mail for a given user
or 3) an alias line - tells smtpd what other names a user is known by.
Mailbox lines have the format "<username> <real name> <mailbox path>" where <username> specifies a valid
recipient at the local address, and <mailbox path> specifies the full pathname of a file in which
to store mail for that user. If the file doesn't exist, smtpd will attempt to create it. If it does
exist, smtpd will append new mail to the end of it (ie the old contents will be preserved.)
The <real name> parameter should be the user's real full name. If this parameter is to include spaces, it
must be enclosed in quotes to protect it from the parsing process. For example these are valid config lines:
ant "Ant Skelton" <MailOut$Dir>.AntMail
or ant Skelton <MailOut$Dir>.AntMail
whereas this is _not_ a valid config line:
ant Ant Skelton <MailOut$Dir>.AntMail
if this line were used in an smtp config file, smtp would assume that user 'ant' has a real name 'Ant' and
that his mail is to be saved in 'Skelton' - ie a file called 'Skelton' off the root directory of your
primary hard-disc. You'll probably agree that this isn't a very desirable state of affairs, so cock-ups of
this nature are best avoided.
Alias lines have the format "<username> alias <realusername>". Any mail arriving addressed to <username>
will be stored in the mailbox for user <realusername>. Note that literal 'alias'. It's not in upper- or
mixed-case, it's in lower-case. smtpd won't like it if you use upper- or mixed-case. And who can blame it?
When smtpd starts, it loads and parses the 'users' file. If there are any errors or discrepancies in the
file then smtpd will complain and fail to start. An example file is provided.
smtpd allows you to use aliases for other aliases as many levels deep as you like, provided that an
actual mailbox emerges at the end of it. Avoid circular references in alias files, as smtpd will become
confused, and probably fall over. As smtpd is by this stage hooked in to a handfull of your more
important vectors, you probably want to avoid this scenario.
Secure operation
----------------
Specifying the -secure switch when running smtpd causes it to implement a very basic level of remote
host authentication. When running in secure mode, smtpd will only accept connections from machines
who's IP addresses are in the file "<SMTPConfig$Dir>.hosts". Lines in this file are either comment
lines (as for the "users" file) or consist of:
<hostname> <numeric IP address>
where <hostname> is a human-readable string, eg 'groovy.org' and <numeric IP address> is the host's
IP address, in 'dot notation' eg "136.170.135.98". An example file is provided.
When a remote machine attempts to connect to smtpd, the module will look it up in its trusted host
database, and if the host isn't recognized the connection will be rejected. (The remote client will
receive the response '421 Service not available', so it won't know that it's been rejected on security
grounds: it only knows that smtpd was unable to talk to it.)
Authentication is done on the numeric IP addresses, as these are slightly harder to forge than human-
readable host names (but realise that they're both pretty easy to forge.) If a trusted host is recognised,
the <hostname> entry from the 'hosts' file is used. In non-secure mode, a DNS lookup is performed.
** NB **
Note that this is fairly primitive security - if you're paranoid about who can connect to your
machine, you're better off not using this module at all. It's mainly intended for use if you'll
typically only be receiving mail from one site - eg via a dial-up to an internet provider.
Logging
-------
Specifying the -log switch when running smtpd causes it to log pertinent information to the file
<SMTPConfig$Dir>.logfile. smtpd logs all connections and mail transfers. In secure mode, smtpd
will also log failed connections.
Star Commands
---- --------
When all's said and done, smtpd is a module, so I couldn't leave you without some * commands to
play with. The following commands are available:
*smtpusers print information on smtp's user database. Includes alias info.
*smtpstats prints information on smtp's internal states. The amount of information
presented by this command varies depending on what smtpd is doing at the
time.
*smtpclose causes an open connection to be terminated, and all state variables are
reset, files closed, etc. Useful as a last ditch measure if smtpd has
jammed and isn't accepting connections. Note that the data in the logfile
may not necessarily be correct if this command is used.
History
-------
smtpd began life as a warm-up exercise in preparation for writing an http server, but due to the recent
population explosion in http servers, I've decided to refine smtpd a bit, and move on to other things.
smtpd has also been prodded along by Dave Walker (who has done an inordinate amount of testing) and
Graham Allan (who wanted an alternative to the NFS mail fetch in the TCPIPtransport module I provide
for NewsBase.) Special mention must also go to siplus@bigblue.demon.co.uk, who ruthlessly persued the
RSET bug. Thanks guys!
Ant.
----
1/6/95, 15/6/95, 20/6/95, 15/11/95, 16/11/95.
<ant@eerie.demon.co.uk>